home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / s-enviro.adb < prev    next >
Text File  |  1994-05-19  |  2KB  |  49 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                    S Y S T E M . E N V I R O N M E N T                   --
  6. --                                                                          --
  7. --                                 B o d y                                  --
  8. --                              (UNIX Version)                              --
  9. --                                                                          --
  10. --                            $Revision: 1.10 $                             --
  11. --                                                                          --
  12. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  13. --                                                                          --
  14. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  15. -- terms of the  GNU General Public License as published  by the Free Soft- --
  16. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  17. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  18. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  19. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  20. -- for  more details.  You should have  received  a copy of the GNU General --
  21. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  22. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. package body System.Environment is
  27.  
  28.    Args : array (0 .. Arg_Count - 1) of Arg_Ptr;
  29.  
  30.    procedure Fill_Arg (A : System.Address; Arg_Num : Integer);
  31.    pragma Interface (C, Fill_Arg);
  32.  
  33.    function Len_Arg (Arg_Num : Integer) return Integer;
  34.    pragma Interface (C, Len_Arg);
  35.  
  36.    function Arg_Value (Arg_Num : Natural) return Arg_Ptr is
  37.    begin
  38.       return Args (Arg_Num);
  39.    end Arg_Value;
  40.  
  41. begin
  42.  
  43.    for J in Args'range loop
  44.       Args (J) := new String (1 .. Len_Arg (J));
  45.       Fill_Arg (Args (J).all'Address, J);
  46.    end loop;
  47.  
  48. end System.Environment;
  49.